package com.lxy.aimin.satoken.admin;

import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpLogic;

public class StpAdminUtil {

    /**
     * 账号体系标识
     */
    public static StpLogic stpLogic = new StpLogic("ADMIN");    // 将 LoginType 从`login`改为`user`


    public static SaTokenInfo login(String key){
        SaLoginModel config = new SaLoginModel();
        config.setIsWriteHeader(false);
        stpLogic.login(key, config);
        return stpLogic.getTokenInfo();
    }


    public static SaTokenInfo getTokenInfo() {
        return stpLogic.getTokenInfo();
    }
}
